/* 
 * File:   mainForm.h
 * Author: f10-kafedra
 *
 * Created on 6 Сентябрь 2011 г., 10:13
 */

#ifndef _MAINFORM_H
#define	_MAINFORM_H

#include "ui_mainForm.h"
#include "tcpSocket.h"
#include "structs.h"
#include "parser.h"
//#include "engine.h"

#include <iostream>
#include <QTimer>

//#define MAGIC_USER_ID 123123
//#define HOST "192.168.9.120"
//#define PORT 6666


using namespace std;

class mainForm : public QMainWindow {
    Q_OBJECT
public:
    mainForm();
    virtual ~mainForm();
    void run();
    
    
    int timerCheckState;
//    requests structRequest;
    tcpSocket* client;
    QTimer* timer;
    parser* srvResp;
    bool started;
    apmType apm;
    bool stateChanged;
    
private:
    Ui::mainForm mainWindow;
    
    
    void setup();
    char* currentOperation(request);
    
    
private slots:
    void slotTimerCheckState();
    void slotUserRequest();
    void slotManualRequestChanged();
    void slotSendManualRequest();
};

#endif	/* _MAINFORM_H */

